﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Examples_Validations_RangeExample : System.Web.UI.MobileControls.MobilePage
{
    protected void Page_Load(object sender, EventArgs e)
    {        
        this.Command1.Click += new System.EventHandler(this.Command1_Click);
        DateTime now = DateTime.Now;
        DateTime dt21yearsago = new DateTime(now.Year - 21, now.Month, now.Day, 0, 0, 0);
        RangeValidator1.MaximumValue = dt21yearsago.ToShortDateString();
        RangeValidator1.Type = System.Web.UI.WebControls.ValidationDataType.Date;
    }
    protected void Command1_Click(object sender, System.EventArgs e)
    {
        if (Page.IsValid)
        {
            ActiveForm = Form2;
        }
    }
   
}